package com.mr.base.alpha.mq;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlphaQueue {

    public final static String TOPIC_ONE = "topic.one";
    public final static String TOPIC_TWO = "topic.two";

    @Bean
    public Queue queue_one() {
        return new Queue(TOPIC_ONE);
    }

    @Bean
    public Queue queue_two() {
        return new Queue(TOPIC_TWO);
    }

    @Bean
    Binding bindingExchangeOne(Queue queue_one, DirectExchange exchange){
        return BindingBuilder.bind(queue_one).to(exchange).with(TOPIC_ONE);
    }

    @Bean
    Binding bindingExchangeALL(Queue queue_two, DirectExchange exchange){
        return BindingBuilder.bind(queue_two).to(exchange).with(TOPIC_TWO);
    }

}
